import { lazy } from "react";
import { createBrowserRouter, Navigate } from "react-router-dom";
const Home = lazy(() => import("../pages/Home/index"));

const router = createBrowserRouter([
    {
        path: "/", element: <Navigate to='/home' />
    },
    {
        path: "/home", element: <Home />
    },
])
export default router;

// import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
// import Home from '../pages/Home/index';
// // 假设这些页面存在，若不存在需创建
// import Page1 from '../pages/Page1';
// import Page2 from '../pages/Page2';
// import Page3 from '../pages/Page3';

// const AppRouter = () => (
//   <Router>
//     <Routes>
//       <Route path="/" element={<Home />} />
//       <Route path="/page1" element={<Page1 />} />
//       <Route path="/page2" element={<Page2 />} />
//       <Route path="/page3" element={<Page3 />} />
//     </Routes>
//   </Router>
// );

// export default AppRouter;